home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 035a / bpq404.zip / BPQHOST.DOC < prev    next >
Text File  |  1991-03-09  |  7KB  |  316 lines

  1.             G8BPQ Host Mode
  2.  
  3. From Version 4.00, a new application interface to the switch will be provided.
  4. This will replace the existing interfaces (TNC2, PK Host and KISS). New
  5. software should if possible use the new interface - interface routines
  6. supporting the old modes, and WA8DED Host mode, will be provided as TSRs
  7. to support existing application software.
  8.  
  9. The interface is normally called using INT 7Fh. From version 4.03 the interrupt
  10. number may be changed - The value is specified in BPQCFG.TXT as INTERRUPT=nnn,
  11. where nnn is in decimal. The function required is in AH, and the stream in AL.
  12. The system supports 64 streams, or sessions, numbered from 1 - 64.
  13.  
  14. ;
  15. ;
  16. ;    COMMANDS SUPPORTED ARE:
  17. ;
  18. ;    Note that in all cases where a string is returned, ES:DI must point to
  19. ;    a buffer supplied by the user, and the switch will copy the data to 
  20. ;    this buffer. The code does NOT return pointers to its own data.
  21.  
  22.  
  23. ;    AH = 1    Set application mask to value in DL.
  24. ;        Set application flags to value in CL.
  25. ;          If top bit of CL is set, monitored frames will be available.
  26. ;          Use function 11 to receive them. 
  27. ;
  28. ;    AH = 2    Send frame in ES:SI (length CX)
  29. ;
  30. ;
  31. ;    AH = 3    Receive frame into buffer at ES:DI, length of frame returned
  32. ;        in CX.  BX returns the number of outstanding frames still to
  33. ;        be received (ie. after this one) or zero if no more frames
  34. ;        (ie. this is last one).
  35. ;
  36. ;
  37. ;
  38. ;    AH = 4    Get stream status.  Returns:
  39. ;
  40. ;        CX = 0 if stream disconnected or CX = 1 if stream connected
  41. ;        DX = 0 if no change of state, or DX = 1 if
  42. ;               the connected/disconnected state has changed.
  43. ;
  44. ;    AH = 5    ACK stream status change. Must be called to allow another
  45. ;        status change to be reported. 
  46. ;
  47. ;
  48. ;    AH = 6    Session control.
  49. ;
  50. ;        CX = 1 connect to node
  51. ;        CX = 2 disconnect
  52. ;        CX = 3 return user to node
  53. ;
  54. ;
  55. ;    AH = 7    Get buffer counts for stream.  Returns:
  56. ;
  57. ;        BX = number of frames queued for receive
  58. ;        CX = number of un-acked frames to be sent
  59. ;        DX = number of buffers left in node
  60. ;
  61. ;
  62. ;    AH = 8    Port control/information.  Called with a stream number
  63. ;        in AL returns:
  64. ;
  65. ;        ES:DI = CALLSIGN (10 bytes space padded)
  66. ;
  67. ;        The following are not supported by the current version,
  68. ;        but I expect to add them soon.
  69. ;
  70. ;        AX = Radio port on which channel is connected (if level 2)
  71. ;        BX = L2 paclen for the session
  72. ;        CX = L2 maxframe for the radio port (if level 2 session) 
  73. ;        DX = L4 window size (if L4 circuit, or zero)
  74. ;
  75. ;
  76. ;    AH = 10    RAW (KISS) transmit frame.  Data pointed to by ES:SI, of
  77. ;        length CX, is transmitted as a HDLC frame on the radio
  78. ;        port (not stream) in AL.
  79. ;
  80. ;
  81. ;    AH = 11 Get Trace (RAW Data) Frame into ES:DI, Length to CX. Data
  82. ;        is as received off air (ie with calls in AX.25 format, etc)
  83. ;
  84. ;
  85. ;    The following additions have been proposed. Similar functions may
  86. ;    be provided, but not necessarily in this format.
  87. ;
  88. ;
  89. ;    AH = 0    Get node/switch version number and description.  On return
  90. ;        AH = major version number and AL = minor version number,
  91. ;        and user's buffer pointed to by ES:SI is set to the text
  92. ;        string normally output by the USERS command. CX is set to the
  93. ;        length of the text string.
  94. ;
  95. ;
  96. ;    AH = 9    Fetch node/application callsign & alias or application names
  97. ;
  98. ;        AL = application
  99. ;        BL = 0 to get Callsign, 1 to get Application Name
  100. ;
  101. ;        number:
  102. ;
  103. ;        0 = node
  104. ;        1 = BBS
  105. ;        2 = HOST
  106. ;        3 = SYSOP etc. etc.
  107. ;
  108. ;        Returns string with alias & callsign or application name in
  109. ;        user's buffer pointed to by ES:SI length CX.  For example:
  110. ;
  111. ;        "WORCS:G8TIC"  or "TICPMS:G8TIC-10".
  112. ;
  113. ;
  114.  
  115. The following sample of code shows how to find the Interrupt Number to use
  116. to call the switch, and check that the switch is loaded.
  117.  
  118.  
  119. NOTBPQERROR    DB    'Switch not found$'
  120. VERSERROR    DB    'Version not compatible with Node Software$'
  121. G8BPQ        DB    'G8BPQ'
  122.  
  123.  
  124.  
  125. BADCONFIGMSG    DB    'Configuration file read error',0DH,0AH,'$'
  126. CONFIGFILENAME    DB    'BPQCFG.BIN',0
  127. NOCONFIGMSG    DB    'Configuration file BPQCFG.BIN not found',0DH,0AH,'$'
  128. ;
  129. ;    BPQCFG FIRST 128 BYTES
  130. ;
  131. CONFIGTABLE    LABEL    BYTE
  132. ;
  133. ;    CONFIGURATION DATA STRUCTURE
  134. ;
  135. ;    DEFINES LAYOUT OF CONFIG RECORD PRODUCED BY CONFIGURATION PROG
  136. ;
  137. ;    LAYOUT MUST MATCH THAT IN CONFIG.C SOURCE
  138. ;
  139. C_NODECALL    DB    10 DUP (0)     ; OFFSET = 0 
  140. C_NODEALIAS    DB    10 DUP (0)     ; OFFSET = 10
  141. C_BBSCALL    DB    10 DUP (0)     ; OFFSET = 20
  142. C_BBSALIAS    DB    10 DUP (0)     ; OFFSET = 30
  143. ;
  144. C_OBSINIT    DW    0         ; OFFSET = 40
  145. C_OBSMIN    DW    0         ; OFFSET = 42
  146. C_NODESINTERVAL    DW    0         ; OFFSET = 44
  147. C_L3TIMETOLIVE    DW    0         ; OFFSET = 46
  148. C_L4RETRIES    DW    0         ; OFFSET = 48
  149. C_L4TIMEOUT    DW    0         ; OFFSET = 50
  150. C_BUFFERS    DW    0         ; OFFSET = 52
  151. C_PACLEN    DW    0         ; OFFSET = 54
  152. C_TRANSDELAY    DW    0         ; OFFSET = 56
  153. C_T3        DW    0         ; OFFSET = 58
  154.            DW    0         ; OFFSET = 60
  155.         DW    0         ; OFFSET = 62
  156. C_IDLETIME    DW    0         ; OFFSET = 64
  157. C_EMSFLAG    DB    0         ; OFFSET = 66
  158.         DB    0
  159. C_BBS        DB    0         ; OFFSET = 68
  160. C_NODE        DB    0         ; OFFSET = 69
  161. C_HOSTINTERRUPT    DB    0         ; OFFSET = 70
  162. C_DESQVIEW    DB    0         ; OFFSET = 71
  163. C_MAXLINKS    DW    0         ; OFFSET = 72
  164. C_MAXDESTS    DW    0
  165. C_MAXNEIGHBOURS    DW    0
  166. C_MAXCIRCUITS    DW    0        ; 78
  167.  
  168. C_TNCPORTLISTO    DB    16 DUP (0)     ; OFFSET = 80
  169.  
  170. C_IDINTERVAL    DW    0        ; 96
  171. C_XXXXXXXX    DW    0        ; 98    ; SPARE (WAS DIGIFLAG)
  172. C_MINQUAL    DW    0        ; 100
  173. C_HIDENODES    DB    0        ; 102
  174. C_L4DELAY    DW    0        ; 103
  175. C_L4WINDOW    DW    0        ; 105
  176. C_BTINTERVAL    DW    0        ; 106
  177. X_UNPROTO    DB    9 DUP (0)    ; 108    ; NOW SPARE
  178. C_BBSQUAL    DW    0        ; 117
  179.         DB    (CONFIGTABLE+128-$) DUP (0)
  180.  
  181.  
  182.  
  183. CONFIGHANDLE    DW    0
  184.  
  185. NODE:
  186.  
  187.     INT    7FH
  188.     RET
  189.  
  190.  
  191. INIT:
  192. ;
  193. ;    GET NODE INTERRUPT NUMBER FROM CONFIG FILE
  194. ;
  195.     MOV    DX,OFFSET CONFIGFILENAME
  196.     MOV    AH,3DH
  197.     MOV    AL,0            ; READ ONLY
  198.     INT    21H            ; OPEN IT
  199.  
  200.     JC    NOCONFIGFILE
  201.  
  202.     MOV    CONFIGHANDLE,AX
  203.  
  204.     MOV    BX,AX
  205.     MOV    DX,OFFSET CONFIGTABLE
  206.     MOV    CX,128
  207.     MOV    AH,3FH
  208.  
  209.     INT    21H            ; READ
  210.     CMP    AX,CX
  211.     JNE    SHORTCONFIG
  212.  
  213.     JMP SHORT PROCESSCONFIG
  214.  
  215. NOCONFIGFILE:
  216.  
  217.     MOV    DX,OFFSET NOCONFIGMSG
  218.     JMP SHORT CONFIGERR
  219.  
  220. SHORTCONFIG:
  221.  
  222.     MOV    DX,OFFSET BADCONFIGMSG
  223.  
  224. CONFIGERR:
  225.  
  226.     MOV    AH,9
  227.     INT    21H
  228.  
  229.     MOV    AX,4C01H
  230.     INT    21H            ; EXIT
  231.  
  232. PROCESSCONFIG:
  233.  
  234.     MOV    BX,CONFIGHANDLE
  235.     MOV    AH,3EH
  236.     INT    21H            ; CLOSE IT
  237.  
  238.     MOV    AL,C_HOSTINTERRUPT    ; INTERRUPT
  239.     MOV    BYTE PTR NODE+1,AL    ; PATCH NODE CALL INSTRUCTION
  240. ;
  241. ;    GET NODE VERSION
  242. ;
  243.     PUSH    DS
  244.     MOV    AH,0
  245.     ADD    AX,AX            ; VECTORS ARE 4 BYTES LONG
  246.     ADD    AX,AX
  247.     MOV    SI,AX
  248.  
  249.     XOR    AX,AX
  250.     MOV    DS,AX
  251.  
  252.     LDS    SI,DS:[SI]        ; GET POINTER TO HOST SUPPORT CODE
  253.  
  254.     SUB    SI,7
  255.     MOV    DI,OFFSET G8BPQ
  256.     MOV    CX,5
  257.     REP CMPSB            ; MAKE SURE SWITCH IS LOADED
  258.  
  259.     JE    SWITCHOK
  260.  
  261.     POP    DS
  262.  
  263.     MOV    DX,OFFSET NOTBPQERROR
  264.  
  265.     MOV    AH,9
  266.     INT    21H
  267.  
  268.     JMP SHORT EXIT
  269.  
  270. SWITCHOK:
  271.  
  272.     CMP    BYTE PTR DS:[SI],MAJORVERSION
  273.     JNE    BADVERSION
  274.  
  275.     CMP    BYTE PTR DS:1[SI],MINORVERSION
  276.     JE    VERSIONOK
  277.  
  278.  
  279. BADVERSION:
  280.  
  281.     POP    DS
  282.  
  283.     MOV    DX,OFFSET VERSERROR
  284.     MOV    AH,9
  285.     INT    21H
  286.  
  287. EXIT:
  288.     MOV    AX,4C00H
  289.     INT    21H
  290.  
  291. BADPORTVAL:
  292.  
  293.     MOV    AH,9
  294.     MOV    DX,OFFSET ERRORMSG
  295.     INT    21H
  296.  
  297.     RET
  298.  
  299. VERSIONOK:
  300.  
  301.     POP    DS
  302. ;
  303.     ..........
  304.  
  305.  
  306.  
  307. The release disk also contains a demonstration terminal program, TERM4,
  308. written by G8IMB (in PASCAL) to demonstate the use of the new interface from
  309. a high level language. Note, however, that it was written for version 4.02,
  310. and therefore only works with the Host Mode interrupt configred at 7Fh
  311.  
  312.  
  313.  
  314. John Wiseman, G8BPQ @ GB7BAD
  315. 20/2/91
  316.